class Fish extends Spirit{
    constructor(type) {
        if(type>5||type<1) throw new Error('鱼的类型只能在1-5之间')

        const data = __g_resource['fish'][`fish${type}`]

        super({
            img:data.img,
            sx:data.frame.x,sy:data.frame.y,
            w:data.frame.w,h:data.frame.h,
            speed:Math.random()*2+0.5,
            rotation:90,
        });
        this.type = type;


        this.max_frame = 4;
        this.max_tick = 8; //200ms
    }
    draw(gd) {
        this.rotation-=90;
        super.draw(gd);
        this.rotation+=90;
    }


}
